﻿using SD.Infrastructure.WPF.Caliburn.Aspects;
using SD.Infrastructure.WPF.Caliburn.Base;
using SlamDunk.MES.IAppService.DTOs.Outputs.ConfigurationContext;
using System;

namespace SlamDunk.MES.Client.ViewModels.Home
{
    /// <summary>
    /// 查看通知视图模型
    /// </summary>
    public class LookNotificationViewModel : ScreenBase
    {
        #region # 字段及构造器

        /// <summary>
        /// 依赖注入构造器
        /// </summary>
        public LookNotificationViewModel()
        {

        }

        #endregion

        #region # 属性

        #region 标题 —— string Title
        /// <summary>
        /// 标题
        /// </summary>
        [DependencyProperty]
        public string Title { get; set; }
        #endregion

        #region 下发日期 —— DateTime IssuedDate
        /// <summary>
        /// 下发日期
        /// </summary>
        [DependencyProperty]
        public DateTime IssuedDate { get; set; }
        #endregion

        #region 优先级 —— int Priority
        /// <summary>
        /// 优先级
        /// </summary>
        [DependencyProperty]
        public int Priority { get; set; }
        #endregion

        #region 工厂模型名称 —— string FacilityName
        /// <summary>
        /// 工厂模型名称
        /// </summary>
        [DependencyProperty]
        public string FacilityName { get; set; }
        #endregion

        #region 描述 —— string Description
        /// <summary>
        /// 描述
        /// </summary>
        [DependencyProperty]
        public string Description { get; set; }
        #endregion

        #endregion

        #region # 方法

        //Initializations

        #region 初始化 —— void Load(NotificationInfo notificationInfo)
        /// <summary>
        /// 初始化
        /// </summary>
        public void Load(NotificationInfo notificationInfo)
        {
            this.Title = notificationInfo.Number;
            this.IssuedDate = notificationInfo.IssuedDate;
            this.Priority = notificationInfo.Priority;
            this.FacilityName = notificationInfo.FacilityInfo?.Name;
            this.Description = notificationInfo.Description;
        }
        #endregion

        #endregion
    }
}
